Imports CrystalDecisions.CrystalReports.Engine

Public Class FrmCrTonNganHang_nhom
    Private customerReport As ReportDocument
    Private nam As String

    Private Sub FormCrTonNganHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        moduleUtils.setDinhDangVietNam()
        Dim sqlQuery As String = "SELECT t1.recycleId,t1.ma_nganhang as manganhang,t2.ten_nganhang as tennganhang , "
        sqlQuery += " t1.TienDauKy, t1.tienThu, t1.tienChi, t1.tienTon FROM tbl_dot_tonnganhang as t1 left join tbl_nganhang as t2 "
        sqlQuery += " on t1.ma_nganhang=t2.ma_nganhang "
        sqlQuery += "WHERE t1.recycleId LIKE '" & nam & "%'  and ( t1.tiendauky <>0 or t1.tienThu <> 0 OR t1.tienChi <> 0 OR t1.tienTon <> 0 ) "
        'Dim sqlQuery As String = "SELECT recycleId, sum(tiendauky) as TienDauKy, "
        'sqlQuery += "sum(tienthu) as tienThu, sum(tienchi) as tienChi, "
        'sqlQuery += "sum(tienton) as tienTon FROM tbl_dot_tonnganhang "
        'sqlQuery += "WHERE recycleId LIKE '" & nam & "%' "
        'sqlQuery += "group by recycleID ORDER BY recycleID"

        Dim reportPath = Application.StartupPath & "\" & "CrTonNganHang_nhom.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        Me.crTonNganHangView.ReportSource = customerReport
    End Sub

    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
End Class